Arithmetic coding-based facsimile compression with error detection

ABSTRACT

A method and apparatus for compressing facsimile documents based on arithmetic coding. A combination of one-dimensional and two-dimensional arithmetic coding is employed to ensure that the effect of a transmission error is not propagated to the whole document. Appropriate contexts for the probabilistic models associated with arithmetic coding for one and two dimensional cases are presented. An error detection scheme to identify the presence of transmission errors is also presented.

This application claims the benefit of provisional application ser. No.60/071,680 filed Jan. 16, 1998.

FIELD OF THE INVENTION

The present invention generally concerns the field of facsimiletransmission of documents, and more particularly concerns an algorithmfor compressing facsimile documents based on arithmetic coding.

BACKGROUND OF THE INVENTION

Arithmetic coding is a well known concept that has been applied in anumber of information transmission environments, including facsimile.The basic idea behind arithmetic coding is the mapping of a sequence ofsymbols to be encoded to a real number in the interval [0.0,1.0), wherea square bracket “[” indicates that equality is allowed and a curvedbracket “)” indicates otherwise. The binary expansion of this realnumber is then transmitted to the arithmetic decoder, where the inversemapping is performed to retrieve the encoded symbols.

Conventional coding techniques, including Huffman coding, assigndistinct code words to different input symbols and achieve datacompression by assigning shorter code words to more probable symbols. Inarithmetic coding, on the contrary, there is no assignment of specificcode words to different input symbols. Instead, the interval [0.0,1.0)is divided into many sub-intervals, each of which is assigned todifferent input symbols. Less probable symbols get short intervals, andcompression is achieved by assigning longer intervals to more probablesymbols.

An illustration of this principle is in FIG. 1, which can form the basisof an example of arithmetic coding. The illustration shows that theinput symbol takes two possible values, B and W. In a facsimiledocument, B and W correspond to black and white picture elements (pel)respectively. Let P_(b) and P_(w), be the probabilities of occurrencesof B and W respectively. To begin with, the coding interval is [0.0,1.0)with the lower bound L₀ 0.0 and the upper bound U₀=1.0 and the range(which is the difference between the upper and lower bound) R₀=1.0. Thiscoding interval is divided into two sub-intervals: [0.0, P_(w))corresponding to W, and [P_(w) 1.0) corresponding to B. The lengths ofthe sub-intervals are proportional to the probabilities of B and W. IfP_(b)=0.75 and P_(w)=0.25, then the interval corresponding to B is threetimes longer than the interval corresponding to W.

When each symbol in the input sequence is coded, the lower bound, theupper bound and the range will experience a change. If the first symbolin the sequence to be encoded is B, the new coding interval is [P_(w),1.0). The upper bound remains the same. The new lower bound is L₁=P_(w),and the new range is R₁=R₀ P_(b)=P_(b). The shaded portion in FIG. 1represents the coding interval.

This coding interval is further sub-divided into two sub-intervals:[P_(w), P_(w),+P_(b)P_(w)) corresponding to W, and [P_(w),+P_(b)P_(w)1.0) corresponding to B. If the next symbol is a W, the new codinginterval is [P_(w), P_(w),+P_(b)P_(w)). The lower bound remainsuncharged at P_(w) and the new range is R₂=R₁P_(w)=P_(b)P_(w). FIG. 1shows the changes in the lower bound, the upper bound and the range forthe first four symbols, the third and fourth symbols both being B. Thelower bound after the third symbol is P_(w),+P_(w)P_(b) ² and the codinginterval [P_(w),+P_(w)P_(b) ², P_(w),+P_(w)P_(b)).

In general, if L_((n−1)),R_((n−1)) are the values of the lower bound andthe range before the n^(th) symbol is encoded, the following rule isused to change these values:

If the n^(th) symbol is B:

L _(n) =L _((n−1)) ,R _((n−1)) P _(w)

R _(n) =R _((n−1)) P _(b).

If the n^(th) symbol is W:

L _(n) =L _((n−1))

 R _(n) =R _((n−1)) P _(w).

The corresponding upper bound U_(n) can be obtained by adding L_(n) andR_(n). Finally, when all the symbols in the input are encoded, thebinary expansion corresponding to any real number in the current codinginterval is transmitted to the arithmetic decoder. With the knowledge ofthe probabilities P_(b) and P_(w), the arithmetic decoder follows thesame sequence of dividing the intervals to retrieve the coded input.

For example, let the encoder encode only three input symbols andtransmit a real number that lies in the coding interval after encodingthe first three symbols. The decoder receives this number and lets it bea value, which lies in the interval [P_(w),+P_(w)P_(b) ²,P_(w),+P_(w)P_(b)). To begin decoding, the decoder divides the codinginterval [0.0, 1.0) into two intervals: [0.0,P_(w)) corresponding to Wand P_(w),1.0) corresponding to B. Since, value lies in the intervalcorresponding to B, the decoder decodes the first symbol to be B. Nowthe new coding interval is [P_(w),1.0), which in turn is sub-dividedinto two intervals, [P_(w), P_(w),+P_(b)P_(w)) corresponding to W and[P_(w),+P_(b)P_(w) 1.0) corresponding to B. Since value lies in theinterval corresponding to W, the decoder decodes the second symbol to beW and proceeds so on.

An important task in arithmetic coding is the proper estimation of theprobabilities P_(b) and P_(w). The compression efficiency that can beachieved depends on the accuracy of these probability estimates. In thediscussion presented above, it was implicitly assumed that the values ofP_(b) and P_(w), are known and remain the same during the encodingprocess. In practice, there does not exist a single set of probabilityvalues that can efficiently model different facsimile documents. Evenwithin a single document, there is so much variation (for example theborders predominantly contain white pels, whereas the text in thedocument contains more black pels), it is not conceivable to use asingle set of probability values.

A more efficient scheme is to initialize the probabilities to a suitablevalue at the start of encoding and adapt the values as the encodingproceeds. In the definition of arithmetic coding, there is norestriction that the probabilities remain unchanged during encoding, aslong as the decoder can exactly mimic the changes in the probabilityvalues. One way of adapting the probabilities is to initialize countsN_(b) and N_(w) to 1 and after encoding each input symbol that is eithera B or W, the corresponding count is incremented by one. Theprobabilities of W and B can be obtained from the counts, using,$P_{w} = \frac{N_{w}}{N_{w} + N_{b}}$

and $P_{w} = {\frac{N_{b}}{N_{w} + N_{b}}.}$

This initialization is an unbiased initialization, since the initialvalues for N_(b) and N_(w) are equal. It is also possible to use abiased initialization.

The aforementioned method to update the counts N_(b) and N_(w) helps toadapt to the local distribution of white and black pels. However, thisscheme fails to exploit the redundancy present in the document. Thecounts N_(b) and N_(w) gives a measure of the probability of a pel beingwhite or black. But, the probability of a pel being white or black canbe better described if the “color” of some of the adjacent pels areknown. This set of adjacent pels is defined to be the context. In FIG.2, the pel marked ‘s’ is being presently encoded and the shaded pelsform the context for ‘s’. The context in this case consists of 4 pels,each of which can be a B or W. So, there are 16 (=2⁴) possiblecombinations (or states) that the context can assume. The redundancy inthe document can be exploited by maintaining a pair of counts for eachpossible state of the context. When a pel ‘s’ is encoded, first thestate is determined from the context and then the counts correspondingto that state are used in encoding.

It is necessary to exercise caution in selecting the context. Selectingtoo small a context might not exploit the redundancy in the documentwell, therefore will decrease the compression efficiency. Selecting toolarge a context, might just increase the computational complexity andmemory requirements without contributing to the compression efficiency.The implementation of arithmetic coding that was used in the simulationsfor this invention is a modification of the version presented in Witten,I. H., Neal, R. M., Cleary, J. G., “Arithmetic Coding for DataCompression”, Communications of the ACM, Volume 30, Number 6, June 1987.

An object of the present invention is the identification of propercontexts for standard facsimile documents, End Of Line (EOL) masking anderror detection.

A further object is prevent the effect of a propagation of atransmission error to the whole document by using a combination ofone-dimensional and two-dimensional arithmetic coding.

Another object is to present appropriate contexts for the probabilisticmodels associated with arithmetic coding for one and two dimensionalcases.

Yet another object is to provide an error detection scheme to identifythe presence of transmission errors.

SUMMARY OF THE INVENTION

The present invention is a facsimile system embodying a signalprocessing method wherein a document is scanned and a sequence ofsymbols is generated for each of a plurality of scan lines. The sequenceof symbols are arithmetic encoded by mapping the symbols to real numbersin a predetermined interval. The real numbers are subject to a binaryexpansion for transmission by a transmitter. After transmission andreception at a receiver, the received signal is inverse mapped toretrieve the encoded signals.

The present invention further comprises arithmetic coding the scan linesusing a combination of one-dimensional and two-dimensional arithmeticcoding. Specifically, the arithmetic encoding step further comprises 2-Dcoding a first plurality of adjacent scan lines, followed by 1-D codingat least one scan line subsequent to the plurality of scan lines. Thissequence of 2-D and 1-D coding can be repeated for a plurality of scanlines generated from scanning a document.

Yet another feature of the invention is the application of an end ofline (EOL) code to each encoded line. In particular, a firstdenomination bit is applied whenever a string of N second denominationbits occurs in the compressed bit stream, the combination of N seconddenomination bits being followed by a first denomination bit toidentifying the sequence as not an EOL

A further feature of the invention is to conduct the scanning with areduced horizontal resolution through minimum difference compression.

Yet another feature of the invention is to apply, at the end of anencoding of a scan line, M bits to represent the “quarter” in which thearithmetic coding interval lies.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a basic illustration of arithmetic coding as applied to thetransmission of black and white symbols.

FIG. 2 is an illustration of a context for arithmetic coding using onedimensional (1-D) and two dimensional (2-D) approaches.

FIG. 3 is a flow chart for error detection at the decoder, in accordancewith the present invention.

FIG. 4 is a flow chart of an arithmetic encoding algorithm used in thepresent invention.

FIG. 5 is a flow chart of an arithmetic decoding algorithm used in thepresent invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention concerns a method and apparatus for compressingfacsimile documents based on arithmetic coding. Underlying the inventionis the use of a combination of one-dimensional and two-dimensionalarithmetic coding, in order to ensure that the effect of a transmissionerror is not propagated to the whole document, together with an errordetection scheme to identify the presence of transmission errors.

Fundamental to the present invention is the task of identifying anappropriate context for one and two dimensional arithmetic coding. FIG.2 shows the contexts used for one and two dimensional coding. Theappropriate contexts were arrived at after thorough experimentation withover 25 facsimile documents in standard resolution, as reflected in ITUrecommendations. Specifically, the Standardization of Group 3 FacsimileApparatus for Document Transmission, ITU-T Recommendation T.4, definesstandard resolution to be 3.85 line/mm and 1728 pels along the scanline. According to the present invention, the horizontal resolution isreduced by half through a maximum-differences compression, which isdesigned to preserve the black-to-white or white-to-black transitions.The resulting document is then coded with arithmetic coding.

Also fundamental is the use of a combination of 1-D and 2-D coding tocode the lines in the facsimile document. A line is said to be 1-Dcoded, if the context used in coding the pels in that line does notcontain any pels from the previous line. Similarly, a line is said to be2-D coded, if the context used in coding the pels in that line containspels from the previous lines. In accordance with a preferred embodimentof the invention, every fourth line is 1-D coded with the threeintermediate lines coded by 2-D coding. Two dimensional coding exploitsthe vertical redundancy in the document, but allows decoding errors in aline to be propagated to the following lines. To prevent this, everyfourth line is 1-D coded. This ensures that any error in the bitstreamcaused by the channel does not propagate to more than four lines.

TABLE 1 Prior Initialization of the probabilities for 2-dimensional Modeof Arithmetic Coding (the pels a, b, c, and d are as designated in FIG.1). Context for Arithmetic Coding Pel a Pel b Pel c Pel d N_(w) N_(b) BB B B 1 27 B B B W 5 23 B B W B 7 21 B B W W 11 17 B W B B 19 9 B W B W13 15 B W W B 15 13 B W W W 19 9 W B B B 9 19 W B B W 13 15 W B W B 1513 W B W W 19 9 W W B B 17 11 W W B W 21 7 W W W B 23 5 W W W W 27 1

Table 1 shows the initial values of the counts used for the twodimensional coding. These initial counts have been arrived at throughtesting over a varied set of facsimile documents. Every fourth scan lineis coded using one dimensional coding. When the following line is codedusing two dimensional coding, the N_(w) and N_(b) are initializedaccording to Table 1. As the encoding process continues these counts areupdated. For 1-D coding, if the context pel is a B, then N_(b) and N_(w)are initialized to be 9 and 1 respectively, and vice versa if thecontext pel is a W. The compression efficiency achieved is different fordifferent documents, but is in the range of 1.6 to 2.0, when compared tothe standard T4 one dimensional compression.

After each scan line is coded using arithmetic coding (either 1D or 2D),it is terminated by an End Of Line (EOL) code. EOL is represented by astring of eleven zeros followed by a one (000000000001). It is necessaryto ensure that this EOL bit combination does not occur in the compressedbit stream representing a scan line. This is achieved by introducing a‘1’ bit whenever a string of ten zeros occurs in the compressed bitstream. While decoding, if the decoder encounters a string of ten zerosand if the next bit is a ‘1’, then it is discarded. If the string of tenzeros is followed by a ‘0’ bit, it is an EOL.

If transmission errors are introduced, they can result in incorrectdecoding of a scan line. However, it is possible to detect theoccurrence of an error, since each scan line is delimited by an EOL andthe number of pels in a scan line is known. There are two possiblescenarios indicating the presence of an error. First, the entire scanline is decoded before an EOL is reached. Second, an EOL is encounteredbefore the entire scan line is decoded. The algorithm used to implementarithmetic coding is a modification of the version presented in Witten,I. H., Neal, R. M., Cleary, J. G., “Arithmetic Coding for DataCompression”, Communications of the ACM, Volume 30, Number 6, June 1987,with 16 bit arithmetic. At the end of an encoding of a scan line, theencoder outputs two bits to represent the “quarter” in which thearithmetic coding interval lies. These two bits can be either ‘01’ or‘10’ and will be followed by the EOL to denote the end of the scan line.However, if the last two bits happen to be ‘10’, this trailing ‘0’ canbe confused with the zeros in EOL. To circumvent this, a ‘1’ bit isintroduced between the two bits representing the “quarter” and the EOL.

For a 16 bit arithmetic implementation, the decoder first reads the 16bits of the compressed data and then exactly mimics the operation of theencoder, i.e., decoder maintains the changes in the values of theprobabilities, coding interval and takes in input bits at the same timewhen the encoder outputs bits, etc. Owing to this nature of theimplementation, the decoder “leads” the encoder by 16 bits, i.e., thedecoder will require 16 bits more than the compressed data output by theencoder to generate a scan line. Since the encoder generates 15 extrabits (2 bits to represent the quarter, a ‘1’ bit and 12 bits in EOL),the decoder would require one more bit after EOL is reached tocompletely decode a scan line. This is used to detect the presence oferrors. The actual value of this extra bit, whether ‘0’ or ‘1’, isimmaterial. If the decoder requires more than one extra bit after EOL togenerate a scan line, then this is an indication of an error. On theother hand, if the decoder does not require an extra bit or if the scanline is decoded before the EOL is reached, this again is an indicationof an error.

FIG. 3 shows a flow chart for error detection at the decoder. As seen atthe top of the figure, a series of compressed bits for a single scanline, illustrated as individual blocks with a 1 or a 0, is followed byan EOC comprising eleven 0's and a single 1. The bits are input to aprocess 101 for starting decoding and outputting a scan line of pictureelements. That series of picture elements is provided to a decision 102as to whether the number of picture elements equals M, where M is adesired number. If so, the processing proceeds along the Y path to adecision 103 as to whether the number of extra input bits used equals 1.If so, the Y path is followed and there is “no error”. If not, the Npath is followed and there is an “error detected”. At decision 102, ifthe number of picture elements is not equal to M, the N path is followedand another decision 104 is used to determine whether EOL has beendetected and an extra bit used. If EOL has been detected and an extrabit has been used, the Y path is followed and an “error detected”indication is given. If EOL has not been detected and extra bit used,the N path takes the program back to the start decoding and output scanline box 101 for further processing.

The arithmetic coding algorithm presented in the “Background” section isnot amenable to implementation with finite precision arithmetic, becauseof precision problems. It can be observed that the range and the lowerbound are floating point numbers between 0.0 and 1.0. The value of rangedecreases every time an input symbol is encoded. Therefore, as theencoding process proceeds, more and more bits are required to representthe range and the lower bound. Eventually, the precision requirementwill not be met by the hardware platform on which the algorithm isimplemented.

A recourse to the above precision problem is to modify the arithmeticcoding algorithm so that lower bound, upper bound and range arerepresented by integers and all operations are restricted to integermanipulations. A modified arithmetic coding algorithm that uses 16-bitinteger arithmetic is presented here. In the following discussion, alldivisions should be interpreted as integer divisions, i.e., for example,10/3=3.

The initial coding interval of [0.0,1.0) is replaced by an integerinterval of 0 to 216−1. The initial values of L₀, U₀ and R₀ are chosento be L₀=0, U₀=2¹⁶−1 and R₀=2¹⁶. Two constants QUAR=(2¹⁶−1)/4 andHALF=2×QUAR are defined. The probabilities ˜b and P,˜, are restrictedsuch that, both these probabilities can be written as a ratio of twointegers, i.e., P_(b)=N_(b)/(N_(b)+N_(w)) and P_(w)=N_(w)/(N_(b)+N_(w)).N_(w) and N_(b) can be interpreted as the counts of number ofoccurrences of the B and W symbols. L_((n−1)), U_((n−1)) and R_((n−1))are the values of lower bound, upper bound and range before the n^(th)symbol is encoded.

With reference to FIG. 4, a flow chart for encoder operation isillustrated and at step 200, symbol to be encoded, as well as the countsN_(w) and N_(b), the bounds L_((n−1)), U_((n−1)) and the rangeR_((n−1)), are input. The following steps are then taken to update thesevalues. First, in a decision 201, a check is made as to whether the nthsymbol is B (or alternatively W). Then in steps 203 and 202,respectively:

If the n^(th) symbol is B:${L_{n} = {L_{({n - 1})} + \frac{R_{({n - 1})}\quad N_{w}}{N_{b} + N_{w}}}};$

If the n^(th) symbol is W:$U_{n} = {L_{({n - 1})} + \frac{R_{({n - 1})}\quad N_{w}}{N_{b} + N_{w}} - 1.}$

The range becomes,

R _(n) =U _(n) −L _(n)+1.

From the above rules, it can be observed that the range R_(n) decreasesprogressively. To avoid this problem, after encoding each symbol andupdating L_(n) and R_(n), the following steps are followed.

Repeat (by returning to point 204) until none of the followingconditions are true:

{

Condition 1 at decision 205: If U_(n)<HALF, then follow the Y path andoutput(0) at step 206;

go to HERE at step 207;

Condition 2 at decision 208: If L_(n)≧HALF, then follow the Y path andoutput(1) at step 209;

L_(n)=L_(n)−HALF;

U_(n)=U_(n)−HALF;

go to HERE at step 207;

Condition 3 at decision 210: If L_(n)≧QUAR and U_(n)<3 QUAR, then followthe Y path and proceed to step 211 where

follow_bits=follow_bits+1;

L_(n)=L_(n)−QUAR;

U_(n)=U_(n)−QUAR;

go to HERE at step 207;

HERE at step 207: L_(n)=2 L_(n); U_(n)=2 U_(n)+1;

}

where the function output( ) takes in a 0 or 1 as an argument and isdefined as follows:

output(x)

{send x to the decoder;

if (follow_bits>0 and x=0) then

send follow_bits 1's to the decoder;

if (follow_bits>0 and x=1) then

send follow_bits 0's to the decoder;

}

After encoding all input symbols, two more bits corresponding to thequarter in which the coding interval lies are sent. If the lower boundis less than QUAR, then the upper bound is greater than HALF, and thecoding interval spans the interval QUAR to HALF. To represent this, bits01 are sent. If the lower bound is greater than or equal to QUAR, thenthe upper bound is greater than 3*QUAR, and the coding interval spansthe interval HALF to 3*QUAR. To represent this, bits 10 are sent.

Turning next to the arithmetic decoder, its functions may be understoodwith regard to FIG. 5 as follows. To begin with at step 300, 16 bitsreceived from the encoder are stored in a register value, with the firstreceived bit placed at the MSB position and the 16^(th) bit placed atthe LSB. L₀, U₀, R₀, N_(b), N_(w), QUAR and HALF are initialized to beexactly the same as at the encoder. The decoder performs the sameoperations performed at the encoder by updating the lower, upper boundand range. Since the update rules are different for symbols B and W, thedecoder has to first decode the symbol. The following rule in step 301is used to decode the symbol:

if$\frac{\left\lbrack {{\left( {{value} - L_{n} + 1} \right)\quad \left( {N_{b} + N_{w}} \right)} - 1} \right\rbrack}{R_{n}} > N_{w}$

then the symbol is B,

otherwise the symbol is W.

Then in steps 303 and 302, respectively:

If the n^(th) symbol is B:${L_{n} = {L_{({n - 1})} + \frac{R_{({n - 1})}\quad N_{w}}{N_{b} + N_{w}}}};$

If the n^(th) symbol is W:$U_{n} = {L_{({n - 1})} + \frac{R_{({n - 1})}\quad N_{w}}{N_{b} + N_{w}} - 1.}$

The range becomes,

R _(n) =U _(n) −L _(n)+1.

From the above rules, it can be observed that the range R_(n) decreasesprogressively. To avoid this problem, after encoding each symbol andupdating L_(n) and R_(n), the following steps are followed.

Repeat (by returning to point 304) until none of the followingconditions are true:

{

Condition 1 at decision 305: If U_(n)<HALF, then follow the Y path andinput(0) at step 306;

go to HERE at step 307;

Condition 2 at decision 308: If L_(n)≧HALF, then follow the Y path andinput(1) at step 309;

L_(n)=L_(n)−HALF;

U_(n)=U_(n)−HALF;

go to HERE at step 307;

Condition 3 at decision 310: If L_(n)≧QUAR and U_(n)<3 QUAR, then followthe Y path and proceed to step 311 where

follow_bits=follow_bits+1;

L_(n)=L_(n)−QUAR;

U_(n)=U_(n)−QUAR;

go to HERE at step 307;

HERE at step 307: L_(n)=2 L_(n); U_(n)=2 U_(n)+1;

}

where the function input( ) takes in a 0 or 1 as an argument and isdefined asi follows:

input(x)

{send x to the encoder;

if (follow_bits>0 and x=0) then

send follow_bits 1's to the encoder;

if (follow_bits>0 and x=1) then

send follow_bits 0's to the encoder;

}

Note the difference at the decoder in that it uses an input( ) functionin place of the output(x) function used at the encoder. The input( )function performs the following:

input( )

{

Left shift the value register by one position;

Place the next bit received from the encoder at the LSB position ofvalue;

}

While the present invention has been described according to certainpreferred embodiments, embodiments are for illustrative purposes onlyand the invention is not limited thereto, but is defined by the claimsappended hereto.

I claim:
 1. In a facsimile system, a signal processing methodcomprising: scanning a document and generating a sequence of symbols foreach of a plurality of scan lines; arithmetic encoding said sequence ofsymbols in said scan lines by mapping said symbols to real numbers in apredetermined interval using a combination of one-dimensional andtwo-dimensional arithmetic coding by 2-D coding a first plurality ofadjacent scan lines followed by 1-D coding at least one scan linesubsequent to said plurality of scan lines; transmitting a signalcomprising a binary expansion of said real numbers; receiving saidtransmitted signal; and inverse mapping said received signals toretrieve the encoded symbols.
 2. The method of claim 1 wherein saidsteps of 2-D encoding followed by 1-D encoding are repeated for aplurality of scan lines generated from a scanning a document.
 3. Themethod of claim 2 wherein, following a 1-D coding of a scan line, asubsequent 2-D encoded line is initialized using updated context.
 4. Themethod of claim 3, further comprising applying a first denomination bitwhenever a string of N second denomination bits occurs in the compressedbit stream, said combination of N second denomination bits followed by afirst denomination bit to identifying the sequence as not an EOL.
 5. Themethod of claim 1 wherein said transmitting step comprises applying anend of line (EOL) code to each encoded line.
 6. The method of claim 1wherein said scanning step is conducted with a reduced horizontalresolution through minimum difference compression.
 7. The method ofclaim 1 wherein the arithmetic encoding step comprises, at the end of anencoding of a scan line, applying M bits to represent the “quarter” inwhich the arithmetic coding interval lies.
 8. The method of claim 7wherein said 2 bits are followed by an EOL to denote the end of the scanline and a third bit is introduced between the two bits representing the“quarter” and the EOL.
 9. The method of claim 1 wherein said arithmeticencoding step represents black and white pels, and wherein thearithmetic coding algorithm utilizes parameters defining a lower bound,an upper bound and a range, wherein said parameters are represented byintegers and all processing comprises integer manipulations.
 10. Amethod of encoding a compressed facsimile signal, comprising a pluralityof B and W symbols, using arithmetic coding, comprising: W-BLACK,W-WHITE, and two constants QUAR=(2¹⁶−1)/4 and HALF=2×QUAR; inputting asymbol to be encoded, as well as initial values of counts N_(w), andN_(b), where N_(W) and N_(B) are the counts of the number of occurrencesof the B and W symbols, lower bound L_((n−1)), upper bound U_((n−1 ))and the range R_((n−1)); updating said initial values, said updatingstep comprising: checking whether the n^(th) symbol is B or W; If then^(th) symbol is B: L _(n) =L _((n−1)) +R _((n−1)) N _(w) N _(b) +N _(w)U _(n) =U _((n−1)) If the n^(th) symbol is W: L _(n) =L _((n−1)); Un=L_((n−1)) +R _((n−1)) N _(w)−1 N _(b) +N _(w) The range becomes, R _(n)=U _(n) −L _(n)+1; after encoding each symbol and updating L_(n) andR_(n), repeat the process until none of the following conditions aretrue: { Condition 1: If U_(n)<HALF, then follow the Y path andoutput(0); go to HERE; Condition 2: If L_(n)≧HALF, then follow the Ypath and output(1); L_(n)=L_(n)−HALF; U_(n)=U_(n)−HALF; go to HERE;Condition 3: If L_(n)≧QUAR and U_(n)<3 QUAR, thenfollow_bits=follow_bits+1; L_(n)=L_(n)−QUAR; U_(n)=U_(n)−QUAR; go toHERE; HERE: L_(n)=2L_(n); U_(n)=2 U_(n)+1; } where the function output() takes in a 0 or 1 as an argument and is defined as follows: output(x){send x to the decoder; if (follow_bits>0 and x=0) then send follow_bits1's to the decoder; if (follow_bits>0 and x=1) then send follow_bits 0'sto the decoder; }.
 11. The method of claim 10, wherein, after encodingall input symbols, two more bits corresponding to the quarter in whichthe coding interval lies are sent.
 12. The method of claim 11 wherein,if the lower bound is less than QUAR, then the upper bound is greaterthan HALF, and the coding interval spans the interval QUAR to HALF andbits 01 are sent; and if the lower bound is greater than or equal toQUAR, then the upper bound is greater than 3*QUAR, and the codinginterval spans the interval HALF to 3*QUAR and bits 10 are sent.
 13. Amethod of decoding a compressed facsimile signal, representing aplurality of B and W symbols that were encoded by using arithmeticcoding, comprising: W-BLACK, W-WHITE, and two constants QUAR=(2¹⁶−1)/4and HALF=2×QUAR; inputting a symbol to be encoded, as well as initialvalues of counts N_(w) and N_(b), where N_(W) and N_(B) are the countsof the number of occurrences of the B and W symbols, lower boundL_((n−1)), upper bound U_((n−1)) and the range R_((n−1)); updating saidinitial values, said updating step comprising: checking whether the nthsymbol is B or W; If the n^(th) symbol is B: L _(n) =L _((n−1)) +R_((n−1)) N _(w) N _(b) +N _(w) U _(n) =U _((n−1)) If the n^(th) symbolis W: L _(n) =L _((n−1)); Un=L _((n−1)) +R _((n−1)) N _(w)−1 N _(b) +N_(w) The range becomes, R _(n) =U _(n) −L _(n)+1; after encoding eachsymbol and updating L_(n) and R_(n) repeat the process until none of thefollowing conditions are true: { Condition 1: If U_(n)<HALF, then followthe Y path and output(0); go to HERE; Condition 2: If L_(n)≧HALF, thenfollow the Y path and output(1); L_(n)=L_(n)−HALF; U_(n)=U_(n)−HALF; goto HERE; Condition 3: If L_(n)≧QUAR and U_(n)<3 QUAR, thenfollow_bits=follow_bits+1; L_(n)=L_(n)−QUAR; U_(n)=U_(n)−QUAR; go toHERE; HERE: L_(n)=2L_(n); U_(n)=2 U_(n)+1; where the function output( )takes in a 0 or 1 as an argument and is defined as follows: output(x){send x to the encoder; if (follow_bits>0 and x=0) then send follow_bits1's to the encoder; if (follow_bits>0 and x=1) then send follow_bits 0'sto the encoder; }.
 14. The method of claim 13, further comprising usingtwo or more bits corresponding to the quarter in which the codinginterval lies are sent for decoding.
 15. The method of claim 13 wherein,if the lower bound is less than QUAR, then the upper bound is greaterthan HALF, and the coding interval spans the interval QUAR to HALF andbits 01 used; and if the lower bound is greater than or equal to QUAR,then the upper bound is greater than 3*QUAR, and the coding intervalspans the interval HALF to 3*QUAR and bits 10 are used.
 16. A facsimilesystem, comprising: means for scanning a document and generating asequence of symbols for each of a plurality of scan lines; means forarithmetic encoding said sequence of symbols in said scan lines bymapping said symbols to real numbers in a predetermined interval using acombination of one-dimensional and two-dimensional arithmetic coding by2-D coding a first plurality of adjacent scan lines followed by 1-Dcoding at least one scan line a subsequent to said plurality of scanlines; means for transmitting a signal comprising a binary expansion ofsaid real numbers; means for receiving said transmitted signal; andmeans for inverse mapping said received signals to retrieve the encodedsymbols.
 17. A facsimile system comprising: a transmitter, saidtransmitter comprising an arithmetic encoder for encoding a compressedfacsimile signal, comprising a plurality of B and W symbols, usingarithmetic coding, said encoder comprising: W-BLACK, W-WHITE, and twoconstants QUAR=(2¹⁶−1)/4 and HALF=2×QUAR; means for inputting a symbolto be encoded, as well as initial values of counts N_(n), and N_(b),where N_(W) and N_(B) are the counts of the number of occurrences of theB and W symbols, lower bound L_((n−1)), upper bound U_((n−1)) and therange R_((n−1)); means for updating said initial values, said updatingstep comprising: checking whether the n^(th) symbol is B or W; If then^(th) symbol is B: L _(n) =L _((n−1)) +R _((n−1)) N _(w) N _(b) +N _(w)U _(n) =U _((n−1)) If the n^(th) symbol is W: L _(n) =L _((n−1)); Un=L_((n−1)) +R _((n−1)) N _(w)−1 N _(b) +N _(w) The range becomes, R _(n)=U _(n) −L _(n)+1; means for, after encoding each symbol and updatingL_(n) and R_(n), repeat the process until none of the followingconditions are true: { Condition 1: If U_(n)<HALF, then follow the Ypath and output(0); go to HERE; Condition 2: If L_(n)≧HALF, then followthe Y path and output(1); L_(n)=L_(n)−HALF; U_(n)=U_(n)−HALF; go toHERE; Condition 3: If L_(n)≧QUAR and U_(n)<3 QUAR, thenfollow_bits=follow_bits+1; L_(n)=L_(n)−QUAR; U_(n)=U_(n)−QUAR; go toHERE; } HERE: L_(n)=2L_(n); U_(n)=2 U_(n)+1; where the function output() takes in a 0 or 1 as an argument and is defined as follows: output(x){send x to the decoder; if (follow_bits>0 and x=0) then send follow_bits1's to the decoder; if (follow_bits>0 and x=1) then send follow_bits 0'sto the decoder; { and a receiver, said receiver comprising a means fordecoding a compressed facsimile signal, representing a plurality of Band W symbols that were encoded by using arithmetic coding, comprising:means for inputting a symbol to be encoded, as well as initial values ofcounts N_(w) and N_(b), where N_(W) and N_(B) are the counts of thenumber of occurrences of the B and W symbols, lower bound L_((n−1)),upper bound U_((n−1)) and the range R_((n−1)); means for updating saidinitial values, said updating step comprising: checking whether the nthsymbol is B or W; If the n^(th) symbol is B: L _(n) =L _((n−1)) +R_((n−1)) N _(w) N _(b) +N _(w) U _(n) =U _((n−1)) If the n^(th) symbolis W: L _(n) =L _((n−1)); Un=L _((n−1)) +R _((n−1)) N _(w)−1 N _(b) +N_(w) The range becomes, R _(n) =U _(n) −L _(n)+1; means for, afterencoding each symbol and updating L_(n) and R_(n) repeat the processuntil none of the following conditions are true: { Condition 1: IfU_(n)<HALF, then follow the Y path and output(0); go to HERE; Condition2: If L_(n)≧HALF, then follow the Y path and output(1);L_(n)=L_(n)−HALF; U_(n)=U_(n)−HALF; go to HERE; Condition 3: IfL_(n)≧QUAR and U_(n)<3 QUAR, then follow_bits=follow_bits+1;L_(n)=L_(n)−QUAR; U_(n)=U_(n)−QUAR; go to HERE; } HERE: L_(n)=2L_(n);U_(n)=2 U_(n)+1; where the function output( ) takes in a 0 or 1 as anargument and is defined as follows: output(x) {send x to the encoder; if(follow_bits>0 and x=0) then send follow_bits 1's to the encoder; if(follow_bits>0 and x=1) then send follow_bits 0's to the encoder.